package org.jeecg.modules.demo.crm.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import java.util.List;

import com.baomidou.mybatisplus.annotation.*;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.demo.crm.annotation.FileField;
import org.jeecg.modules.demo.crm.annotation.TitleField;
import org.jeecg.modules.demo.crm.dto.InvoiceDTO;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @Description: 收款记录
 * @Author: jeecg-boot
 * @Date:   2025-06-20
 * @Version: V1.0
 */
@Data
@TableName("c_payment_record")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="c_payment_record对象", description="收款记录")
public class CPaymentRecord implements Serializable {
    private static final long serialVersionUID = 1L;

	/**id*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id")
    private String id;

    /**收款标题*/
    @Excel(name = "收款标题", width = 15)
    @ApiModelProperty(value = "收款标题")
    @TitleField // AOP 监听文件数据，存入文件表
    private String paymentTitle;

    /**收款备注*/
    @Excel(name = "收款备注", width = 15)
    @ApiModelProperty(value = "收款备注")
    private String paymentRemark;

	/**收款状态*/
	@Excel(name = "收款状态", width = 15)
    @ApiModelProperty(value = "收款状态")
    private String paymentStatus;
	/**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
	/**创建日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
	/**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
	/**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private String sysOrgCode;
	/**更新日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
	/**项目id*/
	@Excel(name = "项目id", width = 15, dictTable = "c_project_application", dicText = "project_name", dicCode = "id")
	@Dict(dictTable = "c_project_application", dicText = "project_name", dicCode = "id")
    @ApiModelProperty(value = "项目id")
    private String projectId;
	/**收款日期*/
	@Excel(name = "收款日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "收款日期")
    private Date paymentDate;
    /**总包主体*/
    @Excel(name = "总包主体", width = 15, dictTable = "c_company_info", dicText = "company_name", dicCode = "id")
    @Dict(dictTable = "c_company_info", dicText = "company_name", dicCode = "id")
    @ApiModelProperty(value = "总包主体")
    private String companyId;
	/**收款金额*/
	@Excel(name = "收款金额", width = 15)
    @ApiModelProperty(value = "收款金额")
    private BigDecimal paymentAmount;
	/**相关文件*/
	@Excel(name = "相关文件", width = 15)
    @ApiModelProperty(value = "相关文件")
    @FileField // AOP 监听文件数据，存入文件表
    private String recordFile;
	/**收款方式*/
	@Excel(name = "收款方式", width = 15, dicCode = "payment_methods")
	@Dict(dicCode = "payment_methods")
    @ApiModelProperty(value = "收款方式")
    private String paymentMethod;
	/**银行名称*/
	@Excel(name = "银行名称", width = 15, dicCode = "bank_name")
	@Dict(dicCode = "bank_name")
    @ApiModelProperty(value = "银行名称")
    private String bankName;
	/**支行信息*/
	@Excel(name = "支行信息", width = 15)
    @ApiModelProperty(value = "支行信息")
    private String bankBranch;
	/**银行账号*/
	@Excel(name = "银行账号", width = 15)
    @ApiModelProperty(value = "银行账号")
    private String accountNumber;
	/**开户人名称*/
	@Excel(name = "开户人名称", width = 15)
    @ApiModelProperty(value = "开户人名称")
    private String accountHolderName;

    @Excel(name = "开票登记", width = 15, dictTable = "c_invoice_apply", dicText = "invoice_number", dicCode = "id")
    @Dict(dictTable = "c_invoice_apply", dicText = "invoice_number", dicCode = "id")
    private String invoiceApplyId;

    @TableField(exist = false)
    @ApiModelProperty(value = "临时数据字段，不存储到数据库")
    private List<CInvoiceApply> invoiceApplys;

    // 新增字段，用于存储临时数据，不映射到数据库
    @TableField(exist = false)
    @ApiModelProperty(value = "临时数据字段，不存储到数据库")
    private List<InvoiceDTO> invoiceApplyList;


}
